package com.diana.springboot.util;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @Author Suna
 * @Date 2020/8/13 16:04
 */
public class ExceptionUtil {

    public static String toString(Throwable throwable) {
        StringWriter stringWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(stringWriter);
        throwable.printStackTrace(printWriter);
        return stringWriter.toString();
    }
}
